<%@page import="com.jfinal.kit.PathKit"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE HTML>

<head>
	<meta charset="utf-8"/>
	<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
</head>
<body>
ajax得到userId的user信息:
<hr>
输入userId:<input type="text" id="userid" name="userid"><button id="btnAjax">ajax得到user信息</button>
<div id="showUser">

</div>
<script type="text/javascript">
	$(function(){
		$("#btnAjax").click(function(){
			$.ajax({
			   type: "POST",
			   url: "/param/ajax",
			   dataType: "json",
			   data: {userid:$("#userid").val()},
			   success: function(msg){
				 html = "id:"+msg.id +"<br/>";
				 html += "username:"+msg.username +"<br/>";
				 html += "pwd:"+msg.pwd +"<br/>";
				 html += "sex:"+msg.sex +"<br/>";
				 html += "birthday:"+msg.birthday +"<br/>";
			     $("#showUser").html(html);
			   },
			   error:function(msg){
				   alert(msg);
			   }
			});
		});
	});
</script>
</body>